﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage1.master" AutoEventWireup="true" CodeFile="a4(购物车).aspx.cs" Inherits="a4_购物车_" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div style="width:1000px;margin:0 auto;">

            <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="XX-Large" ForeColor="#F99D2D" Text="兴隆塑胶有限公司|购物车"></asp:Label>
            <br />
            <br />
            <br />
        <br />
        <div style="width:800px;margin:0 auto;height:300px;">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                DataSourceID="LinqDataSource1" Width="100%" style="text-align: center" 
                onselectedindexchanged="GridView1_SelectedIndexChanged" BackColor="White" 
                BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                AllowPaging="True" PageSize="8">
                <Columns>
                    <asp:TemplateField HeaderText="牌号" SortExpression="shop_sign">
                        <EditItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("shop_sign") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("shop_sign") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="购买量" SortExpression="number">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("number") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" BorderStyle="None" 
                                style="text-align: center" Text='<%# Bind("number") %>' Width="50px"></asp:TextBox>
                            kg
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态">
                        <EditItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
                <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                <RowStyle BackColor="White" ForeColor="#330099" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                <SortedAscendingCellStyle BackColor="#FEFCEB" />
                <SortedAscendingHeaderStyle BackColor="#AF0101" />
                <SortedDescendingCellStyle BackColor="#F6F0C0" />
                <SortedDescendingHeaderStyle BackColor="#7E0000" />
            </asp:GridView>
            <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                ContextTypeName="DataClassesDataContext" EntityTypeName="" 
                Select="new (shop_sign, number, name_user)" TableName="shopping_cart" 
                Where="name_user == @name_user" EnableUpdate="True">
                <WhereParameters>
                    <asp:SessionParameter Name="name_user" SessionField="phone" Type="String" />
                </WhereParameters>
            </asp:LinqDataSource>      
        </div>
        <asp:CheckBox ID="CheckBox2" runat="server" Text="全选" 
                oncheckedchanged="CheckBox2_CheckedChanged" AutoPostBack="True" />
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="确认购买" />
            <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="确认删除" />
            <asp:Button ID="Button3" runat="server" onclick="Button3_Click" Text="确认修改" />

    </div>
</asp:Content>

